package net.onecloud.onecloud.home;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.jude.rollviewpager.RollPagerView;

import net.onecloud.onecloud.R;
import net.onecloud.onecloud.base.BasePage;

/**
 * Created by zaizai on 16/7/26.
 */
public class HomePage extends BasePage {

    private RollPagerView mRollPagerView;
    private View view;
    private AdvertisementAdapter mAdvertisementAdapter;

    public HomePage(Activity activity) {
        super(activity);
        initView();
        initListener();
    }

    private void initListener() {
    }

    private void initView() {
        view = View.inflate(mActivity, R.layout.page_home, null);
        mRollPagerView = (RollPagerView) view.findViewById(R.id.m_rollpagerview);
        mFrameLayoutContent.addView(view);
        mAdvertisementAdapter = new AdvertisementAdapter();
        mRollPagerView.setAdapter(mAdvertisementAdapter);
    }

    @Override
    public void initData() {
        int[] imags={R.drawable.image1,R.drawable.image2};
        mAdvertisementAdapter.setItems(imags);
        mAdvertisementAdapter.notifyDataSetChanged();
    }
}
